﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using AGDN;

namespace Sudum
{
    class EnemySpawner
    {
        //make new enemy every 2 seconds
        const float instantiateTime = 2.0f;
        const float timeDelta = 1.0f / 60.0f;
        float timer;
        public void Update()
        {
            timer += timeDelta;
            //we have arrived at the wanted time
            if (timer >= instantiateTime)
            {
                //reset the timer and make new enemy
                EnemyManager.Me.AddEnemy();
                timer = 0;
            }

        }
    }
}
